<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Html edit helper</title>
</head>

<body>
--------------------------------- html empty input ----------------------------------------------
<{foreach from=$attributes item=att name=foo}>
<{if $tableFlag=="1"}>&lt;tr class=&quot;<{if $smarty.foreach.foo.index %2==0}><{$class1}><{else}><{$class2}><{/if}>&quot;&gt;&lt;td&gt;<br /><{/if}>
<{if $att->hideAttrib}>
  <{$att->attribute}>:&lt;input type=&quot;hidden&quot; name=&quot;<{$att->attribute}>&quot;  id=&quot;<{$att->attribute}>&quot;  value=&quot;&quot; /&gt;
  <br /><{/if}>
  <{if $att->inputAttrib}>
  <{$att->attribute}>:&lt;input name=&quot;<{$att->attribute}>&quot; type=&quot;text&quot; id=&quot;<{$att->attribute}>&quot;  value=&quot;&quot; size=&quot;<{$att->len}>&quot; /&gt;
  <br /><{/if}>
  <{if $att->textareaAttrib}>
  <{$att->attribute}>:&lt;textarea name=&quot;<{$att->attribute}>&quot; cols=&quot;<{$att->len}>&quot; rows=&quot;<{$att->hight}>&quot;  id=&quot;<{$att->attribute}>&quot;&gt;&lt;/textarea&gt; 
  <br /><{/if}>
  <{if $tableFlag=="1"}>&lt;/td&gt;&lt;/tr&gt;<{else}>&lt;br /&gt;<br /><{/if}>
<{/foreach}>

<hr />
--------------------------------- html normal input ----------------------------------------------
<{foreach from=$attributes item=att name=foo}>
  <{if $tableFlag=="1"}>&lt;tr class=&quot;<{if $smarty.foreach.foo.index %2==0}><{$class1}><{else}><{$class2}><{/if}>&quot;&gt;&lt;td&gt;<br /><{/if}>
  <{if $att->hideAttrib}>
  <{$att->attribute}>:&lt;input type=&quot;hidden&quot; name=&quot;<{$att->attribute}>&quot;  id=&quot;<{$att->attribute}>&quot;  value=&quot;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&quot; /&gt;
  <br /><{/if}>
  <{if $att->inputAttrib}>
  <{$att->attribute}>:&lt;input name=&quot;<{$att->attribute}>&quot; type=&quot;text&quot; id=&quot;<{$att->attribute}>&quot;  value=&quot;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&quot; size=&quot;<{$att->len}>&quot; /&gt;
  <br /><{/if}>
  <{if $att->textareaAttrib}>
  <{$att->attribute}>:&lt;textarea name=&quot;<{$att->attribute}>&quot; cols=&quot;<{$att->len}>&quot; rows=&quot;<{$att->hight}>&quot;  id=&quot;<{$att->attribute}>&quot;&gt;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&lt;/textarea&gt; 
  <br /><{/if}>
  <{if $tableFlag=="1"}>&lt;/td&gt;&lt;/tr&gt;<{else}>&lt;br /&gt;<br /><{/if}>
<{/foreach}>

<hr />
--------------------------------- html readonly input ----------------------------------------------
<{foreach from=$attributes item=att name=foo}>
  <{if $tableFlag=="1"}>&lt;tr class=&quot;<{if $smarty.foreach.foo.index %2==0}><{$class1}><{else}><{$class2}><{/if}>&quot;&gt;&lt;td&gt;<br /><{/if}>
  <{if $att->hideAttrib}>
  <{$att->attribute}>:&lt;input type=&quot;hidden&quot; name=&quot;<{$att->attribute}>&quot;  id=&quot;<{$att->attribute}>&quot;  value=&quot;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&quot; /&gt;
  <br /><{/if}>
  <{if $att->inputAttrib}>
  <{$att->attribute}>:&lt;input name=&quot;<{$att->attribute}>&quot; readonly=&quot;readonly&quot; type=&quot;text&quot; id=&quot;<{$att->attribute}>&quot;  value=&quot;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&quot; size=&quot;<{$att->len}>&quot; /&gt;
  <br /><{/if}>
  <{if $att->textareaAttrib}>
  <{$att->attribute}>:&lt;textarea name=&quot;<{$att->attribute}>&quot; readonly=&quot;readonly&quot; cols=&quot;<{$att->len}>&quot; rows=&quot;<{$att->hight}>&quot;  id=&quot;<{$att->attribute}>&quot;&gt;<{$lsm}>$<{$dataObjectName|escape}><{$att->attribute}>|escape<{$rsm}>&lt;/textarea&gt; 
  <br /><{/if}>
  <{if $tableFlag=="1"}>&lt;/td&gt;&lt;/tr&gt;<{else}>&lt;br /&gt;<br /><{/if}>
<{/foreach}>
<hr />
--------------------------------- ReadOnly ------------------------------------javascript ---- 
&lt;script type=&quot;text/javascript&quot;&gt;<br />
  &lt;!--<br />
  function EnableReadonly() { <br />
var formVar=document.form1;
<{foreach from=$attributes item=att name=foo}>
<{if $att->hideAttrib==0}>formVar.<{$att->attribute}>.readOnly=true;
<br /><{/if}>
  <{/foreach}>



<br />
<br />}<br />
  function DisableReadonly (){ <br />
var formVar=document.form1;

<{foreach from=$attributes item=att name=foo}>

<{if $att->hideAttrib==0}>formVar.<{$att->attribute}>.readOnly=false;
  <br /><{/if}>
  <{/foreach}>

  
<br />
<br />}<br />


  function ResetToOriginalValue (){ <br />
  var formVar=document.form1;

<{foreach from=$attributes item=att name=foo}>
formVar.<{$att->attribute}>.value=&quot;<{$lsm}>$<{$dataObjectName}><{$att->attribute}>|escape:'javascript'<{$rsm}>&quot;;
<br />
  <{/foreach}>


<br />
<br />}<br />
//--&gt;
  &lt;/script&gt;
<hr />

<br />
<br /></body>
</html>
